package sealte.database.monitor.config;

import sealte.util.xml.XMLModifier;

public class ConfigModifier {
	
	private String filePath = null;
	private XMLModifier modifier = null;
	
	public ConfigModifier(String fileName){
		this.filePath = ConfigModifier.class.getResource("").getPath()+fileName+".xml";
		System.out.println(filePath);
		this.modifier = new XMLModifier(this.filePath);
	}
	
	public void modifyParam(String[] path,String value) throws Exception {
		this.modifier.modifyElementText(path, value);
	}
	
	public void addParam(String[] parentPath,String name,String value) throws Exception {
		this.modifier.addElement(parentPath, name, value);
	}
	
	public void reWrite() throws Exception {
		this.modifier.reWrite();
	}
}
